//
//  ZGLPlayDetailWebVC.m
//  Faker
//
//  Created by dllo on 15/11/2.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZGLPlayDetailWebVC.h"
#import "UMSocial.h"
#pragma mark 1 - 声明属性 签协议
@interface ZGLPlayDetailWebVC ()

@property (nonatomic, strong) UIWebView *webView;
@property (nonatomic, strong) UIBarButtonItem *rightBar1;

@end

@implementation ZGLPlayDetailWebVC

-(void)viewWillAppear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = YES;
}
-(void)viewWillDisappear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = NO;
}
#pragma mark 2 - 主程序入口
/* 主程序入口 */
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"zaihufanhui"] style:UIBarButtonItemStyleDone target:self action:@selector(leftButton)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    [self creatWebView];
    /* 分享 */
    self.rightBar1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fenxiang"] style:UIBarButtonItemStyleDone target:self action:@selector(share)];
    self.rightBar1.tintColor = [UIColor whiteColor];
    self.navigationItem.rightBarButtonItems = @[self.rightBar1];
    // Do any additional setup after loading the view.
}
#pragma mark 3 - 分享点击事件
/* 分享点击事件 */
-(void)share {
    [UMSocialSnsService presentSnsIconSheetView:self appKey:@"561901f567e58ea2fe003176"shareText:@"友盟社会化分享让您快速实现分享等社会化功能，www.umeng.com/social"shareImage:[UIImage imageNamed:@"icon"] shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,nil] delegate:nil];
}
#pragma mark 4 - 返回点击事件
/* 返回键点击事件 */
-(void)leftButton {
    [self.navigationController popViewControllerAnimated:YES];
    
}
#pragma mark 5 - 属性set方法重写
/* 属性set方法重写 */
-(void)setWebStr:(NSString *)webStr {
    if (_webStr != webStr) {
        _webStr = webStr;
    }
    [self.view reloadInputViews];
}
#pragma mark 6 - 创建webview
/* 创建WebView */
-(void)creatWebView {
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, Width, Height + 50 * ScaleX)];
    [self.view addSubview:self.webView];
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.webStr]]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
